﻿using System;

namespace BikeBouncer.Site
{
	public partial class Error_aspx : BasePage
	{
		#region Main methods

		protected void Page_PreRender(Object sender, EventArgs e)
		{
			GetMessage(Request.QueryString.ToString());
		}

		#endregion

		#region Helper methods

		private void GetMessage(String q)
		{
			if (!String.IsNullOrEmpty(q))
			{
				q = q.ToLower();
			}

			Object msg = GetLocalResourceObject("Msg_" + q);
			Object title = GetLocalResourceObject("Title_" + q);

			if (msg == null)
			{
				msg = GetLocalResourceObject("DefaultMessage");
			}

			if (title == null)
			{
				title = GetLocalResourceObject("PageTitle");
			}

			LitMessage.Text = msg.ToString();
			H1 = title.ToString();
		}

		#endregion
	}
}